public class background {
    public static void main(String[] args) {
        Thread t = new Thread(()-> {
            while(true){
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
                System.out.println("hello run");
            }
        });
        t.setDaemon(true);      //将该进程设置为后台进程
    }
}
